const path = require('path');
const autoprefixer = require('autoprefixer');
const postcssCssnext = require('postcss-cssnext');
const webpackConfig = {
    entry: {
        app: './src/app.js'
    },
    output: {
        path: path.resolve(__dirname, './dist'),
        filename: '[name].bundle.js',
        publicPath: ''
    },
    module: {
        rules: [{
            test: /\.css/,
            use: [{
                    loader: 'style-loader',
                    options: {
                        singleton: true
                    }
                },
                {
                    loader: 'css-loader',
                    options: {
                        // minimize: true
                    }
                },
                {
                    loader: 'postcss-loader',
                    options: {
                        ident: 'postcss',
                        plugins: [
                            // autoprefixer(), 
                            postcssCssnext()
                        ]
                    }
                }
            ]
        }]
    },
    plugins: [

    ]
};

module.exports = webpackConfig;